import axios from 'axios'

const service = axios.create({
  	baseURL: process.env.BASE_API, // api的base_url
  	timeout: 5000 // request timeout,
})

service.interceptors.request.use(config => {
	// if (store.getters.token) {
 //    	// 让每个请求携带token-- ['X-Token']为自定义key 请根据实际情况自行修改
 //    	config.headers['X-Token'] = getToken()
 //  	}
  // Do something before request is sent
  return config
}, error => {
  // Do something with request error
  console.log(error) // for debug
  Promise.reject(error)
})

export default service